<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var s = 1;
        for(var a =1000;a<2000;a++){
            if((0==a % 4 && a % 100 != 0) || (0==a % 400)){
                    document.write(a+"  ");
                    s++;
                    if(s%4==0){
                        document.write("<br>");
                    }
            }
        }
    </script>
</head>
<body>
    
</body>
</html>